import 'package:dk_flutter_base/dk_core.dart';

///该混入为了给PageBloc或者其他Bloc提供一个Map<String, dynamic>，传递数据
///* 会在bloc结束时（dispose）清空该map
mixin ContainerBloc<Event, State> on Bloc<Event, State> {
  Map<String, dynamic> _mapContainer;

  Map<String, dynamic> get mapContainer =>
      objNotEmpty(_mapContainer) ? _mapContainer : _mapContainer = Map();

  @override
  void dispose() {
    super.dispose();
    _mapContainer?.clear();
    _mapContainer = null;
  }
}
